package com.cloud.eurekaconsumerfeignhystrix;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.feign.EnableFeignClients;

/**
 * @EnableFeignClients 开启扫描Spring Cloud Feign客户端的功能
 * 启动工程 eureka-server、eureka-client(两个以上)、eureka-consumer-feign-hystrix
 * 然后访问http://localhost:2101/consumer ，得到正常的返回
 *
 * 为了触发服务降级逻辑，我们可以将服务提供者eureka-client的逻辑加一些延迟
 * Thread.sleep(5000L);   之后重启 client
 * 再次访问，得到  fallback  的返回结果
 *
 */
@EnableFeignClients
@EnableDiscoveryClient
@SpringBootApplication
public class EurekaConsumerFeignHystrixApplication {

	public static void main(String[] args) {
		SpringApplication.run(EurekaConsumerFeignHystrixApplication.class, args);
	}
}
